home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2004 March / PCWMAR04.iso / Software / Trial / TestTrack Pro 6 / ttprowininstall.exe / %LSMAINDIR% / LicenseServer Help / wwhelp / wwhimpl / common / scripts / help.js < prev    next >
Encoding:
JavaScript  |  2003-12-12  |  18.7 KB  |  695 lines

  1. // Copyright (c) 2000-2001 Quadralay Corporation.  All rights reserved.
  2. //
  3.  
  4. function  WWHHelp_GetLocale()
  5. {
  6.   var  Locale = "en";
  7.  
  8.  
  9.   // Reset locale to correct language value
  10.   //
  11.   if ((typeof navigator.language != "undefined") &&
  12.       (navigator.language != null))
  13.   {
  14.     Locale = navigator.language;
  15.   }
  16.   else if ((typeof navigator.userLanguage != "undefined") &&
  17.            (navigator.userLanguage != null))
  18.   {
  19.     Locale = navigator.userLanguage;
  20.   }
  21.  
  22.   // Convert everything to lowercase
  23.   //
  24.   Locale = Locale.toLowerCase();
  25.  
  26.   // Replace '-'s with '_'s
  27.   //
  28.   Locale = WWHStringUtilities_SearchReplace(Locale, "-", "_");
  29.  
  30.   return Locale;
  31. }
  32.  
  33. function  WWHHelp_GetBaseURL(ParamURL)
  34. {
  35.   var  BaseURL;
  36.   var  Parts;
  37.  
  38.  
  39.   BaseURL = ParamURL.substring(0, ParamURL.lastIndexOf("/"));
  40.  
  41.   Parts = BaseURL.split("/wwhelp/wwhimpl/common/html");
  42.   if (Parts[0] == BaseURL)
  43.   {
  44.     Parts = BaseURL.split("/wwhelp/wwhimpl/java/html");
  45.   }
  46.   if (Parts[0] == BaseURL)
  47.   {
  48.     Parts = BaseURL.split("/wwhelp/wwhimpl/js/html");
  49.   }
  50.  
  51.   BaseURL = Parts[0] + "/";
  52.  
  53.   return BaseURL;
  54. }
  55.  
  56. function  WWHHelp_GetURLParams(ParamURL)
  57. {
  58.   var  URLParams = new Array(null, null, null, null);
  59.  
  60.  
  61.   // Check for possible context specification
  62.   //
  63.   if (ParamURL.indexOf("?") != -1)
  64.   {
  65.     var  Parts;
  66.     var  ContextMarker = "context=";
  67.     var  TopicMarker   = "topic=";
  68.     var  FileMarker    = "file=";
  69.     var  HREFMarker    = "href=";
  70.     var  MaxIndex;
  71.     var  Index;
  72.  
  73.  
  74.     Parts = ParamURL.split("?");
  75.  
  76.     // Check for our context tags
  77.     //
  78.     if ((Parts[1].indexOf("&") != -1) &&
  79.         (Parts[1].indexOf(ContextMarker) != -1) &&
  80.         ((Parts[1].indexOf(TopicMarker) != -1) ||
  81.          (Parts[1].indexOf(FileMarker) != -1)))
  82.     {
  83.       Parts = Parts[1].split("&");
  84.  
  85.       // Set context and topic, if specified
  86.       //
  87.       for (MaxIndex = Parts.length, Index = 0 ; Index < MaxIndex ; Index++)
  88.       {
  89.         if (Parts[Index].indexOf(ContextMarker) == 0)
  90.         {
  91.           URLParams[0] = Parts[Index].substring(ContextMarker.length, Parts[Index].length);
  92.         }
  93.         if (Parts[Index].indexOf(TopicMarker) == 0)
  94.         {
  95.           URLParams[1] = Parts[Index].substring(TopicMarker.length, Parts[Index].length);
  96.         }
  97.         if (Parts[Index].indexOf(FileMarker) == 0)
  98.         {
  99.           URLParams[2] = Parts[Index].substring(FileMarker.length, Parts[Index].length);
  100.         }
  101.       }
  102.  
  103.       // Make certain we have both a ContextTag and either a TopicTag or FileTag
  104.       // Otherwise, reset them
  105.       //
  106.       if ((URLParams[0] == null) ||
  107.           ((URLParams[1] == null) &&
  108.            (URLParams[2] == null)))
  109.       {
  110.         URLParams[0] = null;
  111.         URLParams[1] = null;
  112.         URLParams[2] = null;
  113.       }
  114.     }
  115.     else if (Parts[1].indexOf(HREFMarker) == 0) // Check for file tag
  116.     {
  117.       Parts = Parts[1].split("&");
  118.  
  119.       // Set href, if specified
  120.       //
  121.       for (MaxIndex = Parts.length, Index = 0 ; Index < MaxIndex ; Index++)
  122.       {
  123.         if (Parts[Index].indexOf(HREFMarker) == 0)
  124.         {
  125.           URLParams[3] = Parts[Index].substring(HREFMarker.length, Parts[Index].length);
  126.         }
  127.       }
  128.     }
  129.   }
  130.  
  131.   return URLParams;
  132. }
  133.  
  134. function  WWHHelp_Object(ParamURL)
  135. {
  136.   this.mbInitialized   = false;
  137.   this.mInitStage      = 0;
  138.   this.mInitControls   = 0;
  139.   this.mSettings       = new WWHCommonSettings_Object();
  140.   this.mMessages       = new WWHCommonMessages_Object();
  141.   this.mDocumentLoaded = null;
  142.   this.mLocale         = WWHHelp_GetLocale();
  143.   this.mLocationURL    = WWHStringUtilities_NormalizeURL(ParamURL);
  144.   this.mBaseURL        = WWHHelp_GetBaseURL(this.mLocationURL);
  145.   this.mHelpURLPrefix  = WWHStringUtilities_RestoreEscapedSpaces(this.mBaseURL);
  146.   this.mContextDir     = null;
  147.   this.mTopicTag       = null;
  148.   this.mDocumentURL    = "";
  149.   this.mPopup          = new WWHPopup_Object("WWHFrame.WWHHelp.mPopup",
  150.                                              "WWHFrame.WWHContentFrame.WWHDocumentFrame",
  151.                                              WWHPopupFormat_Translate,
  152.                                              WWHPopupFormat_Format,
  153.                                              "WWHPopupDIV", "WWHPopupText", 500, 12, 20,
  154.                                              this.mSettings.mPopup.mWidth);
  155.   this.mBookGroups     = new WWHBookGroups_Object();
  156.   this.mBooks          = new WWHBookList_Object();
  157.  
  158.   this.fInitStage                = WWHHelp_InitStage;
  159.   this.fHandlerInitialized       = WWHHelp_HandlerInitialized;
  160.   this.fControlsLoaded           = WWHHelp_ControlsLoaded;
  161.   this.fSetDocumentFrame         = WWHHelp_SetDocumentFrame;
  162.   this.fSetDocumentHREF          = WWHHelp_SetDocumentHREF;
  163.   this.fDetermineContextDocument = WWHHelp_DetermineContextDocument;
  164.   this.fLoadTopicData            = WWHHelp_LoadTopicData;
  165.   this.fProcessTopicResult       = WWHHelp_ProcessTopicResult;
  166.   this.fDisplayContextDocument   = WWHHelp_DisplayContextDocument;
  167.   this.fSetContextDocument       = WWHHelp_SetContextDocument;
  168.   this.fGetBookFileHREF          = WWHHelp_GetBookFileHREF;
  169.   this.fGetSyncPrevNext          = WWHHelp_GetSyncPrevNext;
  170.   this.fHREFToTitle              = WWHHelp_HREFToTitle;
  171.   this.fShowPopup                = WWHHelp_ShowPopup;
  172.   this.fHidePopup                = WWHHelp_HidePopup;
  173.   this.fClickedPopup             = WWHHelp_ClickedPopup;
  174.   this.fUpdate                   = WWHHelp_Update;
  175.   this.fDocumentBookkeeping      = WWHHelp_DocumentBookkeeping;
  176.  
  177.   // Load up messages
  178.   //
  179.   this.mMessages.fSetByLocale(this.mLocale);
  180. }
  181.  
  182. function  WWHHelp_InitStage(ParamStage)
  183. {
  184.   if (( ! this.mbInitialized) &&
  185.       (ParamStage == this.mInitStage))
  186.   {
  187.     // Perform actions for current init stage
  188.     //
  189.     switch (this.mInitStage)
  190.     {
  191.       case 0:  // Start initialization process
  192.         // Alert the user if this browser is unsupported
  193.         //
  194.         if (WWHFrame.WWHBrowserInfo.mbUnsupported)
  195.         {
  196.           alert(WWHFrame.WWHHelp.mMessages.mBrowserNotSupported);
  197.         }
  198.  
  199.         this.mInitControls = 0;
  200.         WWHFrame.WWHContentFrame.WWHPageNavFrame.WWHControlsLeftFrame.location.replace(this.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/init0.htm");
  201.         break;
  202.  
  203.       case 1:  // Prep book data
  204.         WWHFrame.WWHContentFrame.WWHPageNavFrame.WWHControlsLeftFrame.location.replace(this.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/init1.htm");
  205.         break;
  206.  
  207.       case 2:  // Load book data
  208.         WWHFrame.WWHContentFrame.WWHPageNavFrame.WWHControlsLeftFrame.location.replace(this.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/init2.htm");
  209.         break;
  210.  
  211.       case 3:  // Handler setup
  212.         // Initialize handler
  213.         //
  214.         WWHFrame.WWHHandler.fInit();
  215.         break;
  216.  
  217.       case 4:  // Display controls
  218.         WWHFrame.WWHContentFrame.WWHPageNavFrame.WWHControlsLeftFrame.location.replace(this.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/controll.htm");
  219.         WWHFrame.WWHContentFrame.WWHPageNavFrame.WWHControlsRightFrame.location.replace(this.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/controlr.htm");
  220.         WWHFrame.WWHContentFrame.WWHPageNavFrame.WWHTitleFrame.location.replace(this.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/title.htm");
  221.         break;
  222.  
  223.       case 5:  // Display document
  224.         this.fSetDocumentFrame();
  225.         this.mbInitialized = true;
  226.         break;
  227.     }
  228.  
  229.     // Increment stage
  230.     //
  231.     this.mInitStage++;
  232.   }
  233. }
  234.  
  235. function  WWHHelp_HandlerInitialized()
  236. {
  237.   if (WWHFrame.WWHHelp.mInitStage > 0)
  238.   {
  239.     if (WWHFrame.WWHHandler.mbInitialized)
  240.     {
  241.       WWHFrame.WWHContentFrame.WWHPageNavFrame.WWHControlsRightFrame.location.replace(this.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/init3.htm");
  242.     }
  243.   }
  244. }
  245.  
  246. function  WWHHelp_ControlsLoaded()
  247. {
  248.   if ( ! WWHFrame.WWHHelp.mbInitialized)
  249.   {
  250.     // Only go to final init stage once all control frames have loaded
  251.     //
  252.     this.mInitControls++;
  253.     if (this.mInitControls > 2)
  254.     {
  255.       WWHFrame.WWHHelp.fInitStage(5);
  256.     }
  257.   }
  258. }
  259.  
  260. function  WWHHelp_SetDocumentFrame()
  261. {
  262.   var  DocumentLoaded;
  263.   var  ContextDocumentURL;
  264.  
  265.  
  266.   // Preserve current document if user clicked forward or back to see it
  267.   //
  268.   if (this.mDocumentLoaded != null)
  269.   {
  270.     DocumentLoaded = this.mDocumentLoaded;
  271.  
  272.     this.mDocumentLoaded = null;
  273.     this.fUpdate(DocumentLoaded);
  274.   }
  275.   else
  276.   {
  277.     ContextDocumentURL = this.fDetermineContextDocument();
  278.     if (ContextDocumentURL != null)
  279.     {
  280.       this.fSetDocumentHREF(ContextDocumentURL, true);
  281.     }
  282.     else  // Load topic data to determine document to display
  283.     {
  284.       this.fSetDocumentHREF(this.mBaseURL + "wwhelp/wwhimpl/common/html/document.htm", true);
  285.     }
  286.   }
  287. }
  288.  
  289. function  WWHHelp_SetDocumentHREF(ParamURL,
  290.                                   bParamReplace)
  291. {
  292.   if (ParamURL.length > 0)
  293.   {
  294.     var  EscapedURL = ParamURL;
  295.  
  296.  
  297.     EscapedURL = WWHStringUtilities_RestoreEscapedSpaces(EscapedURL);
  298.     EscapedURL = WWHStringUtilities_EscapeURLForJavaScriptAnchor(EscapedURL);
  299.  
  300.     if (bParamReplace)
  301.     {
  302.       setTimeout("WWHFrame.WWHContentFrame.WWHDocumentFrame.location.replace(\"" + EscapedURL + "\");", 1);
  303.     }
  304.     else
  305.     {
  306.       setTimeout("WWHFrame.WWHContentFrame.WWHDocumentFrame.location = \"" + EscapedURL + "\";", 1);
  307.     }
  308.   }
  309. }
  310.  
  311. function  WWHHelp_DetermineContextDocument()
  312. {
  313.   var  ContextDocumentURL = null;
  314.   var  URLParams          = WWHHelp_GetURLParams(this.mLocationURL);
  315.  
  316.  
  317.   // Check for context specification
  318.   //
  319.   if (URLParams[3] != null)  // href specified
  320.   {
  321.     ContextDocumentURL = this.mBaseURL + URLParams[3];
  322.   }
  323.   else if (URLParams[0] != null)  // context specified
  324.   {
  325.     var  ContextBook;
  326.  
  327.  
  328.     // Determine book directory
  329.     //
  330.     ContextBook = this.mBooks.fGetContextBook(URLParams[0]);
  331.     if (ContextBook != null)
  332.     {
  333.       if (URLParams[2] != null)  // file specified
  334.       {
  335.         ContextDocumentURL = this.mBaseURL + ContextBook.mDirectory + URLParams[2];
  336.       }
  337.       else if (URLParams[1] != null)  // topic specified
  338.       {
  339.         // Setup for a topic search
  340.         //
  341.         this.mContextDir = ContextBook.mDirectory;
  342.         this.mTopicTag   = URLParams[1];
  343.  
  344.         this.mDocumentURL = "";
  345.       }
  346.     }
  347.     else  // Display splash page if nothing else found
  348.     {
  349.       ContextDocumentURL = this.mBaseURL + "wwhelp/wwhimpl/common/html/default.htm";
  350.     }
  351.   }
  352.   else  // Display splash page if nothing else found
  353.   {
  354.     ContextDocumentURL = this.mBaseURL + "wwhelp/wwhimpl/common/html/default.htm";
  355.   }
  356.  
  357.   return ContextDocumentURL;
  358. }
  359.  
  360. function  WWHHelp_LoadTopicData()
  361. {
  362.   var  LoadTopicDataHTML = "";
  363.  
  364.  
  365.   LoadTopicDataHTML += "<script type=\"text/javascript\" language=\"JavaScript1.2\" src=\"" + this.mHelpURLPrefix + WWHStringUtilities_RestoreEscapedSpaces(this.mContextDir) + "wwhdata/common/topics.js\"></script>";
  366.   LoadTopicDataHTML += "<script type=\"text/javascript\" language=\"JavaScript1.2\" src=\"" + this.mHelpURLPrefix + "wwhelp/wwhimpl/common/scripts/documt1s.js\"></script>";
  367.  
  368.   return LoadTopicDataHTML;
  369. }
  370.  
  371. function  WWHHelp_ProcessTopicResult(ParamTopicURL)
  372. {
  373.   if (ParamTopicURL != null)
  374.   {
  375.     this.mDocumentURL = this.mBaseURL + this.mContextDir + ParamTopicURL;
  376.   }
  377. }
  378.  
  379. function  WWHHelp_DisplayContextDocument()
  380. {
  381.   WWHFrame.WWHHelp.fSetDocumentHREF(this.mDocumentURL, true);
  382. }
  383.  
  384. function  WWHHelp_GetURLPrefix(ParamURL)
  385. {
  386.   var  URLPrefix  = null;
  387.   var  WorkingURL = "";
  388.   var  Parts;
  389.   var  Index;
  390.  
  391.  
  392.   // Standardize URL for processing
  393.   //
  394.   WorkingURL = ParamURL;
  395.  
  396.   // Strip any URL parameters
  397.   //
  398.   if (WorkingURL.indexOf("?") != -1)
  399.   {
  400.     Parts = WorkingURL.split("?");
  401.     WorkingURL = Parts[0];
  402.   }
  403.  
  404.   // Confirm URL in wwhelp hierarchy
  405.   //
  406.   if (((Index = WorkingURL.indexOf("/wwhelp/wwhimpl/common/html/switch.htm")) != -1) ||
  407.       ((Index = WorkingURL.indexOf("/wwhelp/wwhimpl/common/html/wwhelp.htm")) != -1) ||
  408.       ((Index = WorkingURL.indexOf("/wwhelp/wwhimpl/java/html/wwhelp.htm"))   != -1) ||
  409.       ((Index = WorkingURL.indexOf("/wwhelp/wwhimpl/js/html/wwhelp.htm"))     != -1))
  410.   {
  411.     URLPrefix = WorkingURL.substring(0, Index);
  412.   }
  413.   else
  414.   {
  415.     // Look for match on top level "wwhelp.htm" file
  416.     //
  417.     Index = WorkingURL.lastIndexOf("/");
  418.     if ((Index != -1) &&
  419.        (Index == WorkingURL.indexOf("/wwhelp.htm")))
  420.     {
  421.       URLPrefix = WorkingURL.substring(0, Index);
  422.     }
  423.   }
  424.  
  425.   return URLPrefix;
  426. }
  427.  
  428. function  WWHHelp_SetContextDocument(ParamURL)
  429. {
  430.   var  URL = WWHStringUtilities_NormalizeURL(ParamURL);
  431.   var  CurrentURLPrefix;
  432.   var  NewURLPrefix;
  433.   var  DocumentURL;
  434.  
  435.  
  436.   // Confirm URL under same hierarchy
  437.   //
  438.   CurrentURLPrefix = WWHHelp_GetURLPrefix(this.mLocationURL);
  439.   NewURLPrefix     = WWHHelp_GetURLPrefix(URL);
  440.   if ((CurrentURLPrefix != null) &&
  441.       (NewURLPrefix     != null) &&
  442.       (CurrentURLPrefix == NewURLPrefix))
  443.   {
  444.     // Check if in single topic mode
  445.     //
  446.     if (this.mLocationURL.indexOf("/wwhelp/wwhimpl/common/html/wwhelp.htm") != -1)
  447.     {
  448.       // Check for required switch to frameset with navigation
  449.       //
  450.       WWHFrame.WWHSwitch.fProcessURL(ParamURL);
  451.       if ( ! WWHFrame.WWHSwitch.mbSingle)
  452.       {
  453.         // Switch to frameset with navigation
  454.         //
  455.         if (WWHFrame.WWHSwitch.mParameters.length > 0)
  456.         {
  457.           // Context and topic supplied, use them
  458.           //
  459.           setTimeout("WWHFrame.location = \"" + WWHStringUtilities_EscapeURLForJavaScriptAnchor(ParamURL) + "\";", 1);
  460.         }
  461.         else
  462.         {
  463.           // Just switch to frameset with navigation and preserve the current document
  464.           //
  465.           DocumentURL = WWHStringUtilities_NormalizeURL(WWHFrame.WWHContentFrame.WWHDocumentFrame.location.href);
  466.           DocumentURL = WWHFrame.WWHHelp.fGetBookFileHREF(DocumentURL);
  467.           WWHFrame.WWHSwitch.fExec(false, WWHFrame.WWHHelp.mHelpURLPrefix + "/wwhelp/wwhimpl/common/html/wwhelp.htm?href=" + WWHStringUtilities_RestoreEscapedSpaces(DocumentURL));
  468.         }
  469.       }
  470.       else
  471.       {
  472.         // Update document frame
  473.         //
  474.         this.mLocationURL = URL;
  475.         this.fSetDocumentFrame();
  476.       }
  477.     }
  478.     else
  479.     {
  480.       // Update document frame
  481.       //
  482.       this.mLocationURL = URL;
  483.       this.fSetDocumentFrame();
  484.     }
  485.   }
  486.   else
  487.   {
  488.     // Some other help system requested, redirect to it
  489.     //
  490.     setTimeout("WWHFrame.location = \"" + WWHStringUtilities_EscapeURLForJavaScriptAnchor(ParamURL) + "\";", 1);
  491.   }
  492. }
  493.  
  494. function  WWHHelp_GetBookFileHREF(ParamHREF)
  495. {
  496.   var  BookFileHREF = null;
  497.  
  498.  
  499.   // Confirm HREF can be in same hierarchy as BaseURL
  500.   //
  501.   if ((this.mBaseURL.length > 0) &&
  502.       (ParamHREF.length > this.mBaseURL.length))
  503.   {
  504.     var  Prefix;
  505.     var  Suffix;
  506.  
  507.  
  508.     Prefix = ParamHREF.substring(0, this.mBaseURL.length);
  509.     Suffix = ParamHREF.substring(this.mBaseURL.length, ParamHREF.length);
  510.  
  511.     // Confirm HREF definitely is in same hierarchy as BaseURL
  512.     //
  513.     if (Prefix == this.mBaseURL)
  514.     {
  515.       BookFileHREF = Suffix;
  516.     }
  517.   }
  518.  
  519.   return BookFileHREF;
  520. }
  521.  
  522. function  WWHHelp_GetSyncPrevNext(ParamHREF)
  523. {
  524.   var  ResultArray = new Array(null, null, null);
  525.   var  Parts;
  526.   var  AbsoluteHREF;
  527.   var  BookFileHREF;
  528.  
  529.  
  530.   // Trim named anchor entries
  531.   //
  532.   Parts = ParamHREF.split("#");
  533.   AbsoluteHREF = Parts[0];
  534.  
  535.   BookFileHREF = this.fGetBookFileHREF(AbsoluteHREF);
  536.   if (BookFileHREF != null)
  537.   {
  538.     if (BookFileHREF == "wwhelp/wwhimpl/common/html/default.htm")
  539.     {
  540.       ResultArray[2] = this.mBooks.fBookFileIndiciesToHREF(0, 0);
  541.     }
  542.     else
  543.     {
  544.       ResultArray = this.mBooks.fGetSyncPrevNext(BookFileHREF);
  545.     }
  546.  
  547.     // Prefix with BaseURL if defined
  548.     //
  549.  
  550.     // Current
  551.     //
  552.     if (ResultArray[0] != null)
  553.     {
  554.       ResultArray[0] = this.mBaseURL + ResultArray[0];
  555.     }
  556.  
  557.     // Previous
  558.     //
  559.     if (ResultArray[1] != null)
  560.     {
  561.       ResultArray[1] = this.mBaseURL + ResultArray[1];
  562.     }
  563.  
  564.     // Next
  565.     //
  566.     if (ResultArray[2] != null)
  567.     {
  568.       ResultArray[2] = this.mBaseURL + ResultArray[2];
  569.     }
  570.   }
  571.   else
  572.   {
  573.     // Unknown document, enable next button to go to first known page
  574.     //
  575.     ResultArray[2] = this.mBaseURL + this.mBooks.fBookFileIndiciesToHREF(0, 0);
  576.   }
  577.  
  578.   return ResultArray;
  579. }
  580.  
  581. function  WWHHelp_HREFToTitle(ParamHREF)
  582. {
  583.   var  HREFTitle;
  584.   var  Parts;
  585.   var  AbsoluteHREF;
  586.   var  BookFileHREF;
  587.  
  588.  
  589.   // Trim named anchor entries
  590.   //
  591.   Parts = ParamHREF.split("#");
  592.   AbsoluteHREF = Parts[0];
  593.  
  594.   BookFileHREF = this.fGetBookFileHREF(AbsoluteHREF);
  595.   Parts = this.mBooks.fGetBookIndexFileHREF(BookFileHREF);
  596.   if (Parts[0] >= 0)
  597.   {
  598.     HREFTitle = this.mBooks.fHREFToTitle(Parts[0], Parts[1]);
  599.   }
  600.   else
  601.   {
  602.     Parts = AbsoluteHREF.split("/");
  603.     HREFTitle = AbsoluteHREF[AbsoluteHREF.length - 1];
  604.   }
  605.  
  606.   return HREFTitle;
  607. }
  608.  
  609. function  WWHHelp_ShowPopup(ParamContext,
  610.                             ParamLink,
  611.                             ParamEvent)
  612. {
  613.   var  PopupHTML;
  614.  
  615.  
  616.   PopupHTML = this.mBooks.fGetPopupHTML(ParamContext, ParamLink);
  617.   if ((PopupHTML != null) &&
  618.       (PopupHTML.length > 0))
  619.   {
  620.     this.mPopup.fShow(PopupHTML, ParamEvent);
  621.   }
  622. }
  623.  
  624. function  WWHHelp_HidePopup()
  625. {
  626.   this.mPopup.fHide();
  627. }
  628.  
  629. function  WWHHelp_ClickedPopup(ParamContext,
  630.                                ParamLink)
  631. {
  632.   var  Link = WWHStringUtilities_NormalizeURL(ParamLink);
  633.   var  LinkHREF = null;
  634.   var  Book;
  635.  
  636.  
  637.   Book = this.mBooks.fGetContextBook(ParamContext);
  638.   if (Book != null)
  639.   {
  640.     // Clickable popup?
  641.     //
  642.     if (Book.mPopups.fIsPopupClickable(ParamLink))
  643.     {
  644.       // Hide the popup if it is visible
  645.       //
  646.       this.fHidePopup();
  647.  
  648.       WWHFrame.WWHHelp.fSetDocumentHREF(this.mBaseURL + Book.mDirectory + Link, false);
  649.     }
  650.   }
  651. }
  652.  
  653. function  WWHHelp_Update(ParamURL)
  654. {
  655.   var  URL;
  656.  
  657.  
  658.   if (this.mInitStage > 0)
  659.   {
  660.     URL = WWHStringUtilities_NormalizeURL(ParamURL);
  661.  
  662.     WWHFrame.WWHHandler.fUpdate(URL);
  663.  
  664.     this.fDocumentBookkeeping(URL);
  665.   }
  666.   else if (ParamURL.indexOf("wwhelp/wwhimpl/common/html/default.htm") == -1)
  667.   {
  668.     this.mDocumentLoaded = ParamURL;
  669.   }
  670. }
  671.  
  672. function  WWHHelp_DocumentBookkeeping(ParamURL)
  673. {
  674.   // Highlight search words
  675.   //
  676.   if (typeof WWHFrame.WWHHighlightWords != "undefined")
  677.   {
  678.     WWHFrame.WWHHighlightWords.fExec();
  679.   }
  680.  
  681.   // Update controls
  682.   //
  683.   WWHFrame.WWHControls.fUpdateHREF(ParamURL);
  684.  
  685.   // Update window title, if possible
  686.   //
  687.   if (ParamURL.indexOf("wwhelp/wwhimpl/common/html/default.htm") == -1)
  688.   {
  689.     if (WWHFrame.WWHBrowserInfo.mBrowser != 1)  // Shorthand for Netscape
  690.     {
  691.       WWHFrame.document.title = this.fHREFToTitle(ParamURL);
  692.     }
  693.   }
  694. }
  695.